using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Elementum
{
    class GameClearTransition : Transition
    {
        protected Animation _back;
        protected float _alpha;

        public GameClearTransition(float startAlpha, float endAlpha, int start, int end)
            : base( start, end) {
                _back = new Animation("images/system/white", new Point(800, 480));
                _back.Alpha = startAlpha;
                _alpha = (endAlpha - startAlpha) / (end - start);
        }

        protected override void OnTransition()
        {
           // base.OnTransition();
            _back.Alpha += _alpha;
        }

        protected override void TransitionDone()
        {
            base.TransitionDone();
        }

        public override void OnDraw(SpriteBatch spriteBatch)
        {
            base.OnDraw(spriteBatch);
            spriteBatch.Begin();
            // if (_counter >= _start && _counter <= _end)
            _back.OnDraw(spriteBatch, new Vector2(400, 240));
            spriteBatch.End();
        }

    }
}
